/*
 * @Author: Simon 1958058172@qq.com
 * @Date: 2025-08-06 18:42:29
 * @LastEditors: Simon 1958058172@qq.com
 * @LastEditTime: 2025-08-06 19:03:13
 * @FilePath: \java.1212\day05\work01\Test.java
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
package day05.work01;

import java.util.Arrays;

public class Test {
    public static void main(String[] args) {
//要求a
        Action action1=new Action() {

            @Override
            public String[] test(String str) {
                //判断字符串是否为空
                if(str==null) {return null;}
                //分割字符串接受字符串
                String[] strings=str.split("\\|");

                return strings;
            }
        };
        System.out.println("输出a:"+Arrays.toString(action1.test("a|b|c")));
//要求b
        Action action2=new Action() {
                        @Override
            public String[] test(String str) {
                //判断字符串是否为空
                if(str==null) {return null;}
                //分割字符串接受字符串
                String[] strings=str.split("\\-");

                return strings;
            }
        };
        System.out.println("输出b:"+Arrays.toString(action2.test("a-b-c")));
    }
}
